<?php
/**
 * Class Controllerindex
 * 首页
 * @author gary
 */
class SocketIndex extends Fend
{
    /**
     * 初始化模板
     */
    public function index()
    {
        Fend_Func::load('FendString');
        $tmy    = array();
        $tmy['user']    = Fend_Di::factory()->get('fduser');
        $tmy['recive']  = Fend_Di::factory()->get('fdrev');
        echo "<pre>";
        print_R($tmy);
        $client = self::getClientList();
        print_r($client);
        return;
        $isjson         = FendString::isJson($tmy['recive']['rev']);
        if($isjson && !empty($tmy['recive']['rev'])){
            $tmy['recive']['rev']  = json_decode($tmy['recive']['rev'],true);
        }
        if(!empty($tmy['recive']['rev']['cmd'])){
            $cmd         = str_replace(array('/','_'),array('/','/'), $tmy['recive']['rev']['cmd']);
            Fend_Acl::Factory()->runSocket($cmd,json_encode($tmy['recive']['rev']));
        }else{
            self::showMsg($tmy);
        }
    }

    public function broder($server_ip,$port)
    {
        $arr = Fend_Cache::factory(1)->getKeys("socket_fd_" . $server_ip . "_" . $port . "_" );
        print_r($arr);

    }

}
